package zheng.mockit.plugin.http.message;

import zheng.mockit.utils.JacksonUtils;

import java.util.Map;

/**
 * Created by zcz on 16-7-29.
 */
public class MockitHttpRequestMessage {

    private String uri;

    private Map<String, String> params;

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public Map<String, String> getParams() {
        return params;
    }

    public void setParams(Map<String, String> params) {
        this.params = params;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MockitHttpRequestMessage that = (MockitHttpRequestMessage) o;

        if (!params.equals(that.params)) return false;
        if (!uri.equals(that.uri)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = uri.hashCode();
        result = 31 * result + params.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return JacksonUtils.toJson(this);
    }
}
